//#include<iostream>
//using namespace std;
//void Test()
//{
//	// 动态申请一个int类型的空间
//	int* ptr1 = new int;
//	// 动态申请一个int类型的空间并初始化为10
//	int* ptr2 = new int(10);
//	// 动态申请10个int类型的空间,并且进行初始化
//	int* ptr3 = new int[10] {1, 2, 3, 4, 5, 6, 7, 8, 9, 10};
//	delete ptr1;
//	delete ptr2;
//	delete[] ptr3;
//}
//int main()
//{
//	Test();
//	return 0;
//}

#include<iostream>
using namespace std;
class A {
public:
	A(int i = 1)
	{
		_p = (int*)malloc(sizeof(int) * i);
		cout << "A()" << endl;
	}
	~A()
	{
		free(_p);
		cout << "~A()" << endl;
	}
private:
	int _a = 1;
	int* _p;
};
int main()
{
	A* a1 = (A*)malloc(sizeof(A));
	free(a1);
	A* a2 = new A;
	delete a2;

	A* a3 = new A[10];
	A* a4 = new A[5]{ 1, 2, 3, 4, 5 };
	return 0;
}